// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ECModelContext.cs" company="ecblog.codeplex.com">
//   emrecoskun.net - ibrahimatay.com
// </copyright>
// <summary>
//   The ec model context
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace EcBlog.Data.Sql
{
    using System.ComponentModel.DataAnnotations;
    using System.Data.Common;
    using System.Data.Entity;
    using System.Data.Entity.ModelConfiguration.Conventions;

    using EcBlog.Data.Sql.Base;
    using EcBlog.Models;

    /// <summary>
    /// The ec model context
    /// </summary>
    public class EcModelContext : TransactionalDbContext
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EcModelContext"/> class.
        /// </summary>
        public EcModelContext()
            : base("DefaultConnection")
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="EcModelContext"/> class.
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        public EcModelContext(string connectionString)
            : base(connectionString)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="EcModelContext"/> class.
        /// </summary>
        /// <param name="connection">The connection.</param>
        public EcModelContext(DbConnection connection)
            : base(connection)
        {
        }

        /// <summary>
        /// Gets or sets the comments.
        /// </summary>
        /// <value>
        /// The comments.
        /// </value>
        public DbSet<Comment> Comments { get; set; }

        /// <summary>
        /// Gets or sets the layouts.
        /// </summary>
        /// <value>
        /// The layouts.
        /// </value>
        public DbSet<Layout> Layouts { get; set; }

        /// <summary>
        /// Gets or sets the tags.
        /// </summary>
        /// <value>
        /// The tags.
        /// </value>
        public DbSet<Tag> Tags { get; set; }

        /// <summary>
        /// Gets or sets the users.
        /// </summary>
        /// <value>
        /// The users.
        /// </value>
        public DbSet<User> Users { get; set; }

        /// <summary>
        /// Gets or sets the pages.
        /// </summary>
        /// <value>
        /// The pages.
        /// </value>
        public DbSet<Page> Pages { get; set; }

        /// <summary>
        /// Gets or sets the site settings.
        /// </summary>
        /// <value>
        /// The site settings.
        /// </value>
        public DbSet<SiteSetting> SiteSettings { get; set; }
        
        /// <summary>
        /// Gets or sets the comment histories.
        /// </summary>
        /// <value>
        /// The comment histories.
        /// </value>
        public DbSet<CommentHistory> CommentHistories { get; set; }

        /// <summary>
        /// Gets or sets the layout histories.
        /// </summary>
        /// <value>
        /// The layout histories.
        /// </value>
        public DbSet<LayoutHistory> LayoutHistories { get; set; }

        /// <summary>
        /// Gets or sets the tag histories.
        /// </summary>
        /// <value>
        /// The tag histories.
        /// </value>
        public DbSet<TagHistory> TagHistories { get; set; }

        /// <summary>
        /// Gets or sets the user histories.
        /// </summary>
        /// <value>
        /// The user histories.
        /// </value>
        public DbSet<UserHistory> UserHistories { get; set; }

        /// <summary>
        /// Gets or sets the page histories.
        /// </summary>
        /// <value>
        /// The page histories.
        /// </value>
        public DbSet<PageHistory> PageHistories { get; set; }

        /// <summary>
        /// Gets or sets the site setting histories.
        /// </summary>
        /// <value>
        /// The site setting histories.
        /// </value>
        public DbSet<SiteSettingHistory> SiteSettingHistories { get; set; }
    }
}